<?php


namespace app\blog\controller\v1;


use app\admin\model\CategoryModel;
use app\BaseController;

class Category extends BaseController
{
    /**
     * 前端获取所有的Category，不需要Token
     * @return \think\response\Json
     * @throws \think\db\exception\DbException
     */
    public function getAllCategory()
    {
        $model = new CategoryModel();
        $re = $model->where("status", "=", "1")->hidden([
            "status", "add_time"
        ])
            ->select()->toArray();
        return successJson($re);
    }


}